﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="MyVideos.aspx.cs" Inherits="JohnnySins.Admin.MyVideos" %>
<%@ Register TagName="FtpVideoChoise" Src="~/Controls/FtpVideoChoice.ascx" TagPrefix="john"  %>
<%@ Register TagName="CustomFileUpload" Src="~/Controls/CustomFileUpload.ascx" TagPrefix="john"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
      $(function () {
         $("#editDialog").dialog({ modal: true, autoOpen: false, width: 800, resizable: false });
         $("#editDialog").parent().appendTo(jQuery("form:first"));
         $(".ui-dialog-titlebar").hide();

         Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function (evt, args) {
            $("#<%=rbMember.ClientID%>, #<%=rbPublic.ClientID%>").change(function () { RefreshMembersFu(); }); 
            RefreshMembersFu();  
         });

         <%=this.JsCodeToRunOnReady%>;
      });

      function RefreshMembersFu()
      {
        if($('#<%=rbMember.ClientID%>').is(':checked'))
            $(".member-fu").show();
        else
            $(".member-fu").hide();
      }

      function createUpdateForm(id) {
         __doPostBack('upDetails', id);
      }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <john:FtpVideoChoise ID="ctrlFtpChoise"  runat="server" />
    <div class="page_title">
        <h1>My Videos</h1>                		
    </div>
                    
    <!--start tabel scenes conetnt-->
    <div class="admin_table_container">
        <asp:UpdatePanel ID="upMyVideo" runat="server" UpdateMode="Conditional">
         <ContentTemplate>
            <div class="row">
                <div class="col-lg-12">
                    <div class="display_inputbox_panel">
                        <h4>Search</h4>
                        <div class="row">
                            <div class="col-lg-5">
                                <div class="display_inputbox_content">
                                                <div class="form-group">
                                                    <label class="col-sm-4 col-md-3 control-label custom_label">Visibility:</label>
                                                    <div class="col-sm-8 col-md-9">
                                                        <asp:DropDownList CssClass="form-control" ID="ddlIsPublicFilter" runat="server">
                                                            <asp:ListItem Text="ALL" Value="ALL"/>
                                                            <asp:ListItem Text="Member" Value="0"/>
                                                            <asp:ListItem Text="Public" Value="1"/>
                                                        </asp:DropDownList>
                                                    </div>
                                                </div>
                                                
                                                <div class="form-group">
                                                    <label for="inputname" class="col-sm-4 col-md-3 control-label custom_label">Page:</label>
                                                    <div class="col-sm-8 col-md-9">
                                                        <asp:DropDownList CssClass="form-control" ID="ddlIsFitnessFilter" runat="server">
                                                            <asp:ListItem Text="ALL" Value="ALL"/>
                                                            <asp:ListItem Text="My Video" Value="0"/>
                                                            <asp:ListItem Text="Fitness" Value="1"/>
                                                        </asp:DropDownList>
                                                    </div>
                                                </div>
                                                                                    
                                </div>                                        
                            </div>
                        </div>
                                
                        <div class="button_group">
                            <asp:Button CssClass="btn btn-info" ID="btnSearch" Text="Search" runat="server" onclick="btnSearch_Click" />
                        </div>
                    </div>
                </div>
            </div>
            <h3>My Videos Scenes</h3>
            <div class="table-responsive">
               <asp:GridView ID="grid" AutoGenerateColumns="false" runat="server" CssClass="table table-bordered table-hover"
                  AllowPaging="False" PageSize="20" OnRowDataBound="grid_RowDataBound" OnRowCommand="grid_Command">
                  <PagerSettings Mode="Numeric" PageButtonCount="4" NextPageText=">" PreviousPageText="<"
                     FirstPageText="<<" LastPageText=">>" />
                  <Columns>
                     <asp:TemplateField>
                        <HeaderTemplate>
                           <asp:CheckBox ID="chbAll" runat="server" AutoPostBack="true" OnCheckedChanged="chbAll_CheckChanged" />
                        </HeaderTemplate>
                        <ItemTemplate>
                           <asp:HiddenField ID="hidId" Value='<%#Eval("MyVideoId")%>' runat="server" />
                           <asp:CheckBox runat="server" Checked='<%#Eval("Selected")%>' ID="cbSelected" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Title/Description">
                        <ItemTemplate>
                           <asp:Label ID="lblMyVideoTitle" Text='<%# Eval("MyVideoTitle") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Preview Video">
                        <ItemTemplate>
                           <asp:Label ID="lblMyVideoFileName" Text='<%# Eval("MyVideoFileName") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="HD Win Video File">
                        <ItemTemplate>
                           <asp:Label ID="lblHDWinFileName" Text='<%# Eval("HDWinFileName") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="LD Win Video File">
                        <ItemTemplate>
                           <asp:Label ID="lblLDWinFileName" Text='<%# Eval("LDWinFileName") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="HD QT Video File">
                        <ItemTemplate>
                           <asp:Label ID="lblHDQTFileName" Text='<%# Eval("HDQTFileName") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="LD QT Video File">
                        <ItemTemplate>
                           <asp:Label ID="lblLDQTFileName" Text='<%# Eval("LDQTFileName") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Status">
                        <ItemTemplate>
                           <asp:Label ID="lblStatus" Text='<%# Eval("Status") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Visibility">
                        <ItemTemplate>
                           <asp:Label ID="lblStatusPublic" Text='<%# Eval("StatusPublic") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Page">
                        <ItemTemplate>
                           <asp:Label ID="lblStatusFitness" Text='<%# Eval("StatusFitness") %>' runat="server" />
                        </ItemTemplate>
                     </asp:TemplateField>
                     <asp:TemplateField HeaderText="Action">
                        <ItemTemplate>
                           <a href='javascript:void(0)' onclick="javascript:createUpdateForm(<%#Eval("MyVideoId")%>);">
                              <img src="<%=ResolveClientUrl("~") %>images/admin/action_icon/edit_icon.png" alt="" title="Edit"
                                 border="0" />
                           </a>
                           <asp:ImageButton runat="server" ImageUrl="~/images/admin/action_icon/delete_icon.gif" ToolTip="Delete"
                              Style="vertical-align: middle;" ID="lbtnDelete" OnCommand="grid_Command" CommandName="delete"
                              CommandArgument='<%# Eval("MyVideoId")%>' OnClientClick="return confirm('Please confirm if you want to delete videos')" />
                           <a href="#"><img border="0" title="Preview" alt="cancle" src="<%=ResolveClientUrl("~") %>images/admin/action_icon/preview_icon.png"></a>
                           <asp:ImageButton ID="btnDeactivate" OnCommand="grid_Command" ToolTip="Deactivate"
                              Style="vertical-align: middle;" CommandName="deactivate" CommandArgument='<%# Eval("MyVideoId")%>'
                              runat="server" OnClientClick="return confirm('Please confirm if you want to deactivate videos')"
                              ImageUrl="~/images/admin/action_icon/deactive.png" />
                           <asp:ImageButton ID="btnActivate" OnCommand="grid_Command" ToolTip="Activate" Style="vertical-align: middle;"
                              CommandName="activate" CommandArgument='<%# Eval("MyVideoId")%>' runat="server"
                              OnClientClick="return confirm('Please confirm if you want to activate videos')"
                              ImageUrl="~/images/admin/action_icon/logout.png" />
                        </ItemTemplate>
                     </asp:TemplateField>
                  </Columns>
               </asp:GridView>
            </div>
         </ContentTemplate>
      </asp:UpdatePanel>

                        
        <div class="button_group">
        <div class="row">
            <div class="col-sm-6 col-lg-6">
                                    <asp:Button CssClass="btn btn-default" ID="btnDeleteSelected" OnClientClick="return confirm('Please confirm if you want to delete selected videos')"
                                        Text="Delete Selected" runat="server" OnClick="btnDeleteSelected_Click" />
                                    <asp:Button CssClass="btn btn-default" ID="btnActivateSelected" OnClientClick="return confirm('Please confirm if you want to activate selected videos')"
                                        Text="Activate Selected" runat="server" OnClick="btnActivateSelected_Click" />
                                    <asp:Button CssClass="btn btn-default" ID="btnDeactivateSelected" OnClientClick="return confirm('Please confirm if you want to deactivate selected videos')"
                                        Text="Deactivate Selected" runat="server" OnClick="btnDeactivateSelected_Click" />
                                    <asp:Button CssClass="btn btn-default" ID="btnCopyToHomeSelected" OnClientClick="return confirm('Please confirm if you want to copy selected videos on home page')"
                                        Text="Add Selected to Home Page" runat="server" OnClick="btnCopyToHomeSelected_Click" />
                                    
            </div>
            <div class="col-sm-6 col-lg-6">
                                    <asp:Button CssClass="btn btn-default" ID="btnReverseSelected" Text="Reverse Selected"
                                        runat="server" OnClick="btnReverseSelected_Click" />
                                    <asp:Button CssClass="btn btn-default" ID="btnRecentSceneUpload" Text="Upload New"
                                        runat="server" OnClientClick="createUpdateForm(-1); return false;" />
            </div>
        </div>                            	
      </div>


    </div>
    <!--end tabel scenes conetnt-->

    <div id="editDialog">
      <asp:UpdatePanel runat="server" ID="upDetails" OnLoad="upDetails_Load" UpdateMode="Conditional"
         ClientIDMode="Static">
         <ContentTemplate>
            <div class="row">
               <div class="fieldset_block col-lg-12 page_area">
                  <fieldset>
                     <legend>
                        <h4>
                           <asp:Label runat="server" ID="lblDialogTitle"></asp:Label>
                        </h4>
                     </legend>
                     <asp:Label runat="server" ID="hdId" Style="display: none;" />
                     <div class="fieldset_content form-horizontal">
                        <div>
                           <div class="col-lg-12">
                              <div class="form-group">
                                 <label class="col-lg-4 control-label">
                                    Title/Description</label>
                                 <div class="col-lg-8">
                                    <asp:TextBox CssClass="form-control" placeholder="Title/Description" ID="txtMyVideoTitle"
                                       ValidationGroup="newItem" runat="server" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="txtMyVideoTitle"
                                       runat="server" Text="*" ValidationGroup="newItem" ForeColor="Red" Display="Dynamic" />
                                 </div>
                              </div>
                              <div class="form-group">
                                 <label class="col-lg-4 control-label">Visibility</label>
                                 <div class="col-lg-8">
                                     <asp:RadioButton ID="rbMember" runat="server" GroupName="groupVisibility"/>Member&nbsp;
                                     <asp:RadioButton ID="rbPublic" runat="server" GroupName="groupVisibility"/>Public
                                 </div>
                              </div>
                              <div class="form-group">
                                 <label class="col-lg-4 control-label">Page</label>
                                 <div class="col-lg-8">
                                    <asp:DropDownList CssClass="form-control" ID="ddlIsFitness" runat="server">
                                       <asp:ListItem Text="My Video" Value="0"></asp:ListItem>
                                       <asp:ListItem Text="Fitness" Value="1"></asp:ListItem>
                                    </asp:DropDownList>
                                 </div>
                              </div>
                              <div class="form-group">
                                 <label class="col-lg-4 control-label">Preview Video</label>
                                 <div class="col-lg-8">
                                    <john:CustomFileUpload ID="fuMyVideoFileName"  runat="server" />
                                 </div>
                              </div>
                              <div class="form-group">
                                 <label class="col-lg-4 control-label">Preview Image Poster</label>
                                 <div class="col-lg-8">
                                    <asp:Panel runat="server" ID="pnlPoster">
                                        <asp:Label runat="server" ID="lblPoster"></asp:Label>
                                        <a href="javascript:void(0)" onclick="ShowFU('<%= pnlPoster.ClientID %>', '<%= fuPoster.ClientID %>', '<%= hdPoster.ClientID %>')">Delete</a>
                                        <asp:HiddenField runat="server" ID="hdPoster" />
                                    </asp:Panel>
                                    <asp:FileUpload runat="server" ID="fuPoster" />
                                 </div>
                              </div>
                              <div class="form-group member-fu">
                                 <label class="col-lg-4 control-label">HD Win Video File</label>
                                 <div class="col-lg-8">
                                    <john:CustomFileUpload ID="fuHDWinFileName"  runat="server" />
                                 </div>
                              </div>
                              <div class="form-group member-fu">
                                 <label class="col-lg-4 control-label">LD Win Video File</label>
                                 <div class="col-lg-8">
                                    <john:CustomFileUpload ID="fuLDWinFileName"  runat="server" />
                                 </div>
                              </div>
                              <div class="form-group member-fu">
                                 <label class="col-lg-4 control-label">HD QT Video File</label>
                                 <div class="col-lg-8">
                                    <john:CustomFileUpload ID="fuHDQTFileName"  runat="server" />
                                 </div>
                              </div>
                              <div class="form-group member-fu">
                                 <label class="col-lg-4 control-label">LD QT Video File</label>
                                 <div class="col-lg-8">
                                    <john:CustomFileUpload ID="fuLDQTFileName"  runat="server" />
                                 </div>
                              </div>
                              <div class="form-group">
                                 <label class="col-lg-4 control-label">
                                    State</label>
                                 <div class="col-lg-8">
                                    <asp:DropDownList CssClass="form-control" ID="ddlIsActive" runat="server">
                                       <asp:ListItem Text="Active" Value="1"></asp:ListItem>
                                       <asp:ListItem Text="Deactivate" Value="0"></asp:ListItem>
                                    </asp:DropDownList>
                                 </div>
                              </div>
                           </div>
                        </div>
                        <div class="button_group">
                           <asp:Button CssClass="btn btn-success" ID="btnSave" ValidationGroup="newItem" Text="Save" OnClientClick="BlockInt('Saving data...');"
                              runat="server" OnClick="btnSave_Click" ClientIDMode="Static" />
                           <asp:Button CssClass="btn btn-info" ID="btnCancel" Text="Cancel" runat="server" OnClientClick="$('#editDialog').dialog('close'); return false;"
                              ClientIDMode="Static" />
                        </div>
                     </div>
                  </fieldset>
               </div>
            </div>
         </ContentTemplate>
         <Triggers>
            <asp:PostBackTrigger ControlID="btnSave" />
         </Triggers>
      </asp:UpdatePanel>
   </div>
</asp:Content>
